//
//  ExPrinterModel.swift
//  Swift-Example
//
//  Created by apang on 2018/8/25.
//  Copyright © 2018 apang.men All rights reserved.
//

import UIKit

class ExPrinterModel: NSObject {
    public var printer: UIPrinter? {
        willSet {
            if (newValue != nil ) {
                //此处监听不执行原因不知道
                newValue?.contactPrinter({ (availabel) in
                    print((availabel ? "可以使用" : "无法使用"))
                    if availabel == false {
                        self.printer = nil
                    }
                })
            }
        }
    }
    
    static let shared = ExPrinterModel()
    
    private override init() {}
    
    override func copy() -> Any {
        return self
    }
    override func mutableCopy() -> Any {
        return self
    }
}
